#include <iostream>
#include <vector>
#include <unistd.h>
#include "Thread.hpp"

using namespace std;

void Print()        //返回类型不用是指针，也无需void*的参数
{
    while(true)
    {
        std::cout << "hello, snowdragon write" << std::endl;
        sleep(1);
    }
    //return nullptr;
}

int main()
{
    // Thread td(Print);
    // td.Start();
    // cout << "name: " << td.GetName() << endl;
    // cout << "timestamp: " << td.GetTimestamp() << endl;
    // cout << "isrunning: " << td.IsRunning() << endl;
    // td.Join();

    vector<Thread> threads;
    for(int i = 0; i < 5; ++i)
    {
        threads.push_back(Thread(Print));
    }
    for(auto &td : threads)
    {
        td.Start();
    }
    for(auto &td : threads)
    {
        td.Join();
    }

    return 0;
}